<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 教室管理控制器
 */
class Classroom extends AdminBase
{
    
    /**
     * 教室信息列表
     */
    public function roomlist()
    {
        
        $this->assign('list', $this->logicClassroom->getClassroomList());
        
        return $this->fetch('room_list');
    }
    /**
     * 占用教室列表
     */
    public function usedRoomList()
    {
        $where['status']=['eq',-2];
        $this->assign('list', $this->logicClassroom->getClassroomList($where));
        return $this->fetch('room_list');
    }
    public function returnRoom()
    {
        $where['status']=['eq',-2];
        $this->assign('list', $this->logicClassroom->getClassroomList($where));
        return $this->fetch('returnroom_list');
    }
    /**
     * 查询教室列表
     */
    public function classList()
    {
        $where = $this->logicClassroom->getWhere($this->param);
        
        $this->assign('list', $this->logicClassroom->getClassroomList($where));
        
        return $this->fetch('room_list');
    }


    /**
     * 课程信息列表
     */
    public function timetable_list()
    {
        
        $this->assign('list', $this->logicSubject->getSubjectList());
        
        return $this->fetch('tabletime_list');
    }



    /**
     * 教室添加
     */
    public function roomAdd()
    {
        
        IS_POST && $this->jump($this->logicClassroom->roomEdit($this->param));
        
        return $this->fetch('room_edit');
    }
    
    /**
     * 友情链接编辑
     */
    public function roomEdit()
    {
        
        IS_POST && $this->jump($this->logicClassroom->roomEdit($this->param));
        
        $info = $this->logicClassroom->getClassroomInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('room_edit');
    }
    
    /**
     * 友情链接删除
     */
    public function roomDel($id = 0)
    {
        
        return $this->fetch('returnRoom_list');
    }
}